<?php

if (isset ($_GET['raison'])) {

	$connexion = mysql_connect("localhost", "root", "");
	mysql_select_db("trombinoscope", $connexion);
	
	extract($_GET);
	enregister($nom, $presence);
	echo 'Sauvegarde réussit';
}else{
	echo "Y'a RIEN !!";
}

function enregister($nom, $presence) {
	//$date= date("Y-m-j H:i:s");
	$sql = "INSERT INTO etudiant(nom, presence, date) VALUES ('$nom', '$presence', NOW()) ";
	mysql_query($sql) or die('Requête invalide : ' . mysql_error());
	
}

?>
